-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(angular-query): call withDevtools function within injection conte… #9236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
View your CI Pipeline Execution ↗ for commit e0cb4c8.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9236 +/- ##
===========================================
+ Coverage 45.33% 85.98% +40.64%
===========================================
Files 207 16 -191
Lines 8271 321 -7950
Branches 1860 75 -1785
===========================================
- Hits 3750 276 -3474
+ Misses 4080 40 -4040
+ Partials 441 5 -436 🚀 New features to boost your workflow:
|
Just have to think about how to write a test case for it - help welcome :) |
b052807
to
e0cb4c8
Compare
I don't think a computation function should use There's good reasons Angular doesn't run export const appConfig: ApplicationConfig = {
providers: [
provideTanStackQuery(
new QueryClient(),
withDevtools(
(devToolsOptionsManager: DevtoolsOptionsManager) => ({
loadDevtools: devToolsOptionsManager.loadDevtools(),
}),
{
// `deps` can be used to pass one or more injectables as parameters to the `withDevtools` callback.
deps: [DevtoolsOptionsManager],
},
),
),
],
} It's similar to the Angular It is possible to add type inference to the Angular adapter's types btw, but because of TypeScript limitations it would need a separate overload per number of The branch also adds conditional exports which greatly improves tree shaking and other devtools improvements. Haven't touched it in a month, I'll review it a bit and see if I can open a PR. |
Hey I generally agree with everything especially the part regarding For me personally this API looks fine. I do not see any major advantages or disadvantages of having another syntax. It does the job and it should be quite understandable. |
Cool thanks, gives me confidence to move forward with this. API design, thinking of many use cases and avoiding future breaking changes is hard 😅 |
Agree - This is a complete different discipline :) |
…xt to not throw
Bug description
Following this example:
will throw a runtime error that
inject
must be called from within an injection context.